home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2004 July / APC0407D2.iso / workshop / onlineco / files / ImageMagick-6.0.1-Q16-windows-dll.exe / {app} / include / magick / cache.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-02-21  |  4.3 KB  |  214 lines

  1. /*
  2.   ImageMagick Cache Methods.
  3. */
  4. #ifndef _MAGICK_CACHE_H
  5. #define _MAGICK_CACHE_H
  6.  
  7. #if defined(__cplusplus) || defined(c_plusplus)
  8. extern "C" {
  9. #endif
  10.  
  11. #include "magick/blob.h"
  12.  
  13. typedef enum
  14. {
  15.   UndefinedCache,
  16.   MemoryCache,
  17.   MapCache,
  18.   DiskCache
  19. } CacheType;
  20.  
  21. typedef enum
  22. {
  23.   UndefinedVirtualPixelMethod,
  24.   ConstantVirtualPixelMethod,
  25.   EdgeVirtualPixelMethod,
  26.   MirrorVirtualPixelMethod,
  27.   TileVirtualPixelMethod
  28. } VirtualPixelMethod;
  29.  
  30. typedef void
  31.   *Cache;
  32.  
  33. typedef IndexPacket
  34.   *(*GetIndexesFromHandler)(const Image *);
  35.  
  36. typedef const PixelPacket
  37.   *(*AcquirePixelHandler)(const Image *,const long,const long,
  38.     const unsigned long,const unsigned long,ExceptionInfo *);
  39.  
  40. typedef PixelPacket
  41.   (*AcquireOnePixelFromHandler)(const Image *,const long,const long,
  42.     ExceptionInfo *);
  43.  
  44. typedef PixelPacket
  45.   (*GetOnePixelFromHandler)(Image *,const long,const long);
  46.  
  47. typedef PixelPacket
  48.   *(*GetPixelHandler)(Image *,const long,const long,const unsigned long,
  49.     const unsigned long);
  50.  
  51. typedef PixelPacket
  52.   *(*GetPixelsFromHandler)(const Image *);
  53.  
  54. typedef PixelPacket
  55.   *(*SetPixelHandler)(Image *,const long,const long,const unsigned long,
  56.     const unsigned long);
  57.  
  58. typedef unsigned int
  59.   (*SyncPixelHandler)(Image *);
  60.  
  61. typedef void
  62.   (*DestroyPixelHandler)(Image *);
  63.  
  64. typedef struct _CacheMethods
  65. {
  66.   AcquireOnePixelFromHandler
  67.     acquire_one_pixel_from_handler;
  68.  
  69.   AcquirePixelHandler
  70.     acquire_pixel_handler;
  71.  
  72.   DestroyPixelHandler
  73.     destroy_pixel_handler;
  74.  
  75.   GetIndexesFromHandler
  76.     get_indexes_from_handler;
  77.  
  78.   GetOnePixelFromHandler
  79.     get_one_pixel_from_handler;
  80.  
  81.   GetPixelHandler
  82.     get_pixel_handler;
  83.  
  84.   GetPixelsFromHandler
  85.     get_pixels_from_handler;
  86.  
  87.   SetPixelHandler
  88.     set_pixel_handler;
  89.  
  90.   SyncPixelHandler
  91.     sync_pixel_handler;
  92. } CacheMethods;
  93.  
  94. typedef struct _NexusInfo NexusInfo;
  95.  
  96. typedef struct _CacheInfo
  97. {
  98.   unsigned long
  99.     id;
  100.  
  101.   NexusInfo
  102.     *nexus_info;
  103.  
  104.   unsigned long
  105.     number_views;
  106.  
  107.   ClassType
  108.     storage_class;
  109.  
  110.   ColorspaceType
  111.     colorspace;
  112.  
  113.   CacheType
  114.     type;
  115.  
  116.   unsigned long
  117.     columns,
  118.     rows;
  119.  
  120.   MagickOffsetType
  121.     offset;
  122.  
  123.   MagickSizeType
  124.     length;
  125.  
  126.   PixelPacket
  127.     *pixels;
  128.  
  129.   IndexPacket
  130.     *indexes;
  131.  
  132.   VirtualPixelMethod
  133.     virtual_pixel_method;
  134.  
  135.   PixelPacket
  136.     virtual_pixel;
  137.  
  138.   int
  139.     file;
  140.  
  141.   char
  142.     filename[MaxTextExtent],
  143.     cache_filename[MaxTextExtent];
  144.  
  145.   CacheMethods
  146.     methods;
  147.  
  148.   unsigned int
  149.     debug;
  150.  
  151.   long
  152.     reference_count;
  153.  
  154.   void
  155.     *semaphore;
  156.  
  157.   unsigned long
  158.     signature;
  159. } CacheInfo;
  160.  
  161. extern MagickExport Cache
  162.   ReferenceCache(Cache);
  163.  
  164. extern MagickExport ClassType
  165.   GetCacheClass(const Cache);
  166.  
  167. extern MagickExport ColorspaceType
  168.   GetCacheColorspace(const Cache);
  169.  
  170. extern MagickExport const PixelPacket
  171.   *AcquireCacheNexus(const Image *,const long,const long,const unsigned long,
  172.     const unsigned long,const unsigned long,ExceptionInfo *);
  173.  
  174. extern MagickExport MagickSizeType
  175.   GetPixelCacheArea(const Image *);
  176.  
  177. extern MagickExport IndexPacket
  178.   *GetNexusIndexes(const Cache,const unsigned long);
  179.  
  180. extern MagickExport PixelPacket
  181.   *GetCacheNexus(Image *,const long,const long,const unsigned long,
  182.     const unsigned long,const unsigned long),
  183.   *GetNexusPixels(const Cache,const unsigned long),
  184.   *SetCacheNexus(Image *,const long,const long,const unsigned long,
  185.     const unsigned long,const unsigned long);
  186.  
  187. extern MagickExport unsigned int
  188.   OpenCache(Image *,const MapMode),
  189.   PersistCache(Image *,const char *,const unsigned int,
  190.     MagickOffsetType *,ExceptionInfo *),
  191.   SetImageVirtualPixelMethod(const Image *,const VirtualPixelMethod),
  192.   SyncCacheNexus(Image *,const unsigned long);
  193.  
  194. extern MagickExport unsigned long
  195.   GetNexus(Cache);
  196.  
  197. extern MagickExport VirtualPixelMethod
  198.   GetImageVirtualPixelMethod(const Image *);
  199.  
  200. extern MagickExport void
  201.   ClonePixelCacheMethods(Cache,const Cache),
  202.   DestroyCacheInfo(Cache),
  203.   DestroyCacheNexus(Cache,const unsigned long),
  204.   GetCacheInfo(Cache *),
  205.   SetPixelCacheMethods(Cache,AcquirePixelHandler,GetPixelHandler,
  206.     SetPixelHandler,SyncPixelHandler,GetPixelsFromHandler,GetIndexesFromHandler,
  207.     AcquireOnePixelFromHandler,GetOnePixelFromHandler,DestroyPixelHandler);
  208.  
  209. #if defined(__cplusplus) || defined(c_plusplus)
  210. }
  211. #endif
  212.  
  213. #endif
  214.